import { ElMessage, ElMessageBox } from 'element-plus';


// 消息提示
export function showMessage(message = '提示内容', type = 'success', customClass = '') {
    return ElMessage({
        type: type,
        message,
        customClass,
    })
}
// 弹出确认框
export function showModel(content = '提示内容', type = 'warning', title = '') {
    return ElMessageBox.confirm(
        content,
        title,
        {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type,
        }
    )
}
// 全局权限校验方法
export const checkPermission = (requiredRoles, userRole) => {
    // 未配置角色视为公共菜单
    if (!requiredRoles || !requiredRoles.length) return true
    return requiredRoles.includes(userRole)
}